﻿using System;
using System.Collections.Generic;
using System.Text;
using Zhuang.Utility.Common.DataBase;
using System.Collections;

namespace Zhuang.DAL.Access
{
    public class Pos_PendingOrderMasterDAL
    {
        public void Add(string name)
        {
            ArrayList alSql = new ArrayList();

            string strSql = @"Insert into Pos_PendingOrderMaster(PendingOrderName,PendingOrderDate) values('{0}','{1}')";
            strSql = string.Format(strSql,name,DateTime.Now);
            alSql.Add(strSql);
            strSql = @"Insert into Pos_PendingOrderDetail(PendingOrderMasterId,ProductId,ProductName,ProductCode,UnitPrice,Quantity)
            select (select max(PendingOrderMasterId) from Pos_PendingOrderMaster),ProductId,ProductName,ProductCode,UnitPrice,Quantity from Pos_CurrentOrder";
            alSql.Add(strSql);

            OleDbHelper.ExecuteSqlTran(alSql);
            
        }

    }
}
